import 'package:jinke/utils/util.dart';

import 'file_show_vo_list.dart';

class ProPhaseModel {
  String? id;
  String? phaseLimitTime;
  String? projectId;
  String? phaseName;
  String? phaseCode;
  int? phaseOrder;
  String? phaseCompleteTime;
  String? phaseStatus;
  String? phaseActualCompleteTime;
  String? phaseSummary;
  int? inThisPhase;
  List<FileShowVoList>? fileShowVoList;

  ProPhaseModel({
    this.id,
    this.phaseLimitTime,
    this.projectId,
    this.phaseName,
    this.phaseCode,
    this.phaseOrder,
    this.phaseCompleteTime,
    this.phaseStatus,
    this.phaseActualCompleteTime,
    this.phaseSummary,
    this.inThisPhase,
    this.fileShowVoList,
  });

  factory ProPhaseModel.fromJson(Map<String, dynamic> json) => ProPhaseModel(
        id: json['id'] as String?,
        phaseLimitTime: json['phaseLimitTime'] as String?,
        projectId: json['projectId'] as String?,
        phaseName: json['phaseName'] as String?,
        phaseCode: json['phaseCode'] as String?,
        phaseOrder: json['phaseOrder'] as int?,
        phaseCompleteTime: json['phaseCompleteTime'] as String?,
        phaseStatus: json['phaseStatus'] as String?,
        phaseActualCompleteTime: json['phaseActualCompleteTime'] as String?,
        phaseSummary: json['phaseSummary'] as String?,
        inThisPhase: numVal(json['inThisPhase']).toInt(),
        fileShowVoList: (json['fileShowVOList'] as List<dynamic>?)
            ?.map((e) => FileShowVoList.fromJson(e as Map<String, dynamic>))
            .toList(),
      );

  Map<String, dynamic> toJson() => {
        'id': id,
        'phaseLimitTime': phaseLimitTime,
        'projectId': projectId,
        'phaseName': phaseName,
        'phaseCode': phaseCode,
        'phaseOrder': phaseOrder,
        'phaseCompleteTime': phaseCompleteTime,
        'phaseStatus': phaseStatus,
        'phaseActualCompleteTime': phaseActualCompleteTime,
        'phaseSummary': phaseSummary,
        'inThisPhase': inThisPhase,
        'fileShowVOList': fileShowVoList?.map((e) => e.toJson()).toList(),
      };
}
